/**==============================================================================
            Copyright (c) 2013 Moritz Hader, Marcel Schrder
            All Rights Reserved.

	@file  HeimdallAbstractElement.java

	@brief  Abstract element that defines the basic-methods and properties
	of objects in the render-tree. Both, the node and the 3DObject inherit
	from this abstract element to implement a file-system like pattern (OO-Pattern).

  This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
==============================================================================*/

package de.ibm.dhbw.heimdall.engine;

import de.ibm.dhbw.heimdall.engine.math.HVector3D;

public class HeimdallAbstractElement {
	private HVector3D LocScale;
		protected HVector3D IScale; //Inherited Scale
	private HVector3D LocPosition;
		protected HVector3D IPosition;
	private HVector3D LocRotation;
		protected HVector3D IRotation;
	
	private int infoID;
		
	public int getInfoID(){
		return this.infoID;
	}
	
	public void setInfoID(int id){
		this.infoID = id;
	}
	
	public HVector3D getLocScale() {
		return LocScale;
	}
	public void setLocScale(HVector3D locScale) {
		LocScale = locScale;
	}
	public HVector3D getLocPosition() {
		return LocPosition;
	}
	public void setLocPosition(HVector3D locPosition) {
		LocPosition = locPosition;
	}
	public HVector3D getLocRotation() {
		return LocRotation;
	}
	public void setLocRotation(HVector3D locRotation) {
		LocRotation = locRotation;
	}
	
	public void inheritProperties(HeimdallAbstractElement elem){
		//The inherited property is always the property of the predecessor+its inherited property
		
		this.IPosition = elem.getLocPosition().add(elem.IPosition);
		this.IRotation = elem.getLocRotation().add(elem.IRotation);
		
		//The scale behaves like the position/rotation, but needs to be multiplied
		this.IScale = elem.getLocScale().scale(elem.IScale);
	}
	
	public void natifyObject(){};
	public void denatifyObject(){};
	
}
